cmake_minimum_required(VERSION 3.10)
project(UniversalNodeManager)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找依赖
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBGIT2 REQUIRED libgit2)

# 包含目录
include_directories(include)

# 源文件
set(SOURCES
    src/core/node_manager.cpp
    src/providers/git_provider.cpp
)

# 主库
add_library(unm SHARED ${SOURCES})
target_link_libraries(unm ${LIBGIT2_LIBRARIES})
target_include_directories(unm PUBLIC include)

# 示例程序
add_executable(submodule_example examples/submodule_manager.cpp)
target_link_libraries(submodule_example unm ${LIBGIT2_LIBRARIES})

# 安装目标
install(TARGETS unm DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
